<include file="Common:layout" />
<body style="background-color: #FFF; overflow: auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <a class="back" href="javascript:history.back();" title="返回列表">
                <i class="fa fa-arrow-circle-o-left"></i>
            </a>
            <div class="subject">
                <h3>权限分配</h3>
                <h5>系统角色权限分配</h5>
            </div>
        </div>
    </div>
    <form class="form-horizontal" action="{:U('Auth/set_auth')}" id="roleform" method="post">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="cls_full">
                        为角色组 <span class="red">{$role['name']}</span> 分配权限
                    </label>
                </dt>
                <dd style="margin-left:200px;">
                    <div class="ncap-account-container" style="border-top:none;">
                        <h4>
                            <input id="cls_full" onclick="choosebox(this)" type="checkbox">
                            <label>全选</label>
                        </h4>
                    </div>
                    <div class="ncap-account-container" style="border-top:none;">
                        <h4>
                            <label>商户中心</label>
                            <input value="1" cka="mod-1" type="checkbox">
                            <label>全部</label>
                        </h4>
                        <ul class="ncap-account-container-list">
                            <li><label><input class="checkbox" ck="mod-1" name="urls[]" value="XXX/XXX" <?php if(in_array("XXX/XXX" ,$urls)){ echo "checked"; } ?> type="checkbox">积分设置</label></li>
                            <li><label><input class="checkbox" ck="mod-1" name="urls[]" value="XXX/XXX" <?php if(in_array("XXX/XXX" ,$urls)){ echo "checked"; } ?> type="checkbox">售后设置</label></li>
                            <li><label><input class="checkbox" ck="mod-1" name="urls[]" value="XXX/XXX" <?php if(in_array("XXX/XXX" ,$urls)){ echo "checked"; } ?> type="checkbox">会员设置</label></li>
                            <li><label><input class="checkbox" ck="mod-1" name="urls[]" value="system/sms_template" <?php if(in_array("system/sms_template" ,$urls)){ echo "checked"; } ?> type="checkbox">消息设置</label></li>
                            <li><label><input class="checkbox" ck="mod-1" name="urls[]" value="express/index" <?php if(in_array("express/index" ,$urls)){ echo "checked"; } ?> type="checkbox">运费模板</label></li>
                            <li><label><input class="checkbox" ck="mod-1" name="urls[]" value="payment/paylist" <?php if(in_array("payment/paylist" ,$urls)){ echo "checked"; } ?> type="checkbox">交易设置</label></li>
                            <li><label><input class="checkbox" ck="mod-1" name="urls[]" value="XXX/XXX" <?php if(in_array("XXX/XXX" ,$urls)){ echo "checked"; } ?> type="checkbox">信息认证</label></li>
                        </ul>
                    </div>

                    <div class="ncap-account-container" style="border-top:none;">
                        <h4>
                            <label>店铺设置</label>
                            <input value="1" cka="mod-2" type="checkbox">
                            <label>全部</label>
                        </h4>
                        <ul class="ncap-account-container-list">
                            <li><label><input class="checkbox" ck="mod-2" name="urls[]" value="XXX/XXX" <?php if(in_array("XXX/XXX" ,$urls)){ echo "checked"; } ?> type="checkbox">店铺数据</label></li>
                            <li><label><input class="checkbox" ck="mod-2" name="urls[]" value="diy/index" <?php if(in_array("diy/index" ,$urls)){ echo "checked"; } ?> type="checkbox">主页设置</label></li>
                            <li><label><input class="checkbox" ck="mod-2" name="urls[]" value="XXX/XXX" <?php if(in_array("XXX/XXX" ,$urls)){ echo "checked"; } ?> type="checkbox">素材管理</label></li>
                        </ul>
                    </div>
                    <div class="ncap-account-container" style="border-top:none;">
                        <h4>
                            <label>商品管理</label>
                            <input value="1" cka="mod-3" type="checkbox">
                            <label>全部</label>
                        </h4>
                        <ul class="ncap-account-container-list">
                            <li><label><input class="checkbox" name="urls[]" ck="mod-3" value="good/index" <?php if(in_array("good/index" ,$urls)){ echo "checked"; } ?> type="checkbox">商品列表</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-3" value="brand/index" <?php if(in_array("brand/index" ,$urls)){ echo "checked"; } ?> type="checkbox">品牌管理</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-3" value="XXX/XXX" <?php if(in_array("XXX/XXX" ,$urls)){ echo "checked"; } ?> type="checkbox">商品规格</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-3" value="good/batch_upload" <?php if(in_array("good/batch_upload" ,$urls)){ echo "checked"; } ?> type="checkbox">商品导入</label></li>
                        </ul>
                    </div>

                    <div class="ncap-account-container" style="border-top:none;">
                        <h4>
                            <label>会员管理</label>
                            <input value="1" cka="mod-4" type="checkbox">
                            <label>全部</label>
                        </h4>
                        <ul class="ncap-account-container-list">
                            <li><label><input class="checkbox" name="urls[]" ck="mod-4" value="members/member_list" <?php if(in_array("members/member_list" ,$urls)){ echo "checked"; } ?> type="checkbox">会员列表</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-4" value="members/members_act" <?php if(in_array("members/members_act" ,$urls)){ echo "checked"; } ?> type="checkbox">充值记录</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-4" value="members/member_amt" <?php if(in_array("members/member_amt" ,$urls)){ echo "checked"; } ?> type="checkbox">资金变动</label></li>
                        </ul>
                    </div>

                    <div class="ncap-account-container" style="border-top:none;">
                        <h4>
                            <label>代理管理</label>
                            <input value="1" cka="mod-5" type="checkbox">
                            <label>全部</label>
                        </h4>
                        <ul class="ncap-account-container-list">
                            <li><label><input class="checkbox" name="urls[]" ck="mod-5" value="agent/index" <?php if(in_array("agent/index" ,$urls)){ echo "checked"; } ?> type="checkbox">代理列表</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-5" value="agent/upgrade" <?php if(in_array("agent/upgrade" ,$urls)){ echo "checked"; } ?> type="checkbox">代理升级</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-5" value="agent/fund_change" <?php if(in_array("agent/fund_change" ,$urls)){ echo "checked"; } ?> type="checkbox">资金变动</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-5" value="members/members" <?php if(in_array("members/members" ,$urls)){ echo "checked"; } ?> type="checkbox">商机</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-5" value="account/index" <?php if(in_array("account/index" ,$urls)){ echo "checked"; } ?> type="checkbox">充值记录</label></li>
                        </ul>
                    </div>

                    <div class="ncap-account-container" style="border-top:none;">
                        <h4>
                            <label>订单列表</label>
                            <input value="1" cka="mod-6" type="checkbox">
                            <label>全部</label>
                        </h4>
                        <ul class="ncap-account-container-list">
                            <li><label><input class="checkbox" name="urls[]" ck="mod-6" value="order/index" <?php if(in_array("order/index" ,$urls)){ echo "checked"; } ?> type="checkbox">订单列表</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-6" value="order/return_list" <?php if(in_array("order/return_list" ,$urls)){ echo "checked"; } ?> type="checkbox">退款审核</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-6" value="order/send_order" <?php if(in_array("order/send_order" ,$urls)){ echo "checked"; } ?> type="checkbox">发货单</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-6" value="order/ready_send" <?php if(in_array("order/ready_send" ,$urls)){ echo "checked"; } ?> type="checkbox">代发货</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-6" value="order/order_opt_records" <?php if(in_array("order/order_opt_records" ,$urls)){ echo "checked"; } ?> type="checkbox">订单日志</label></li>

                        </ul>
                    </div>

                    <div class="ncap-account-container" style="border-top:none;">
                        <h4>
                            <label>数据统计</label>
                            <input value="1" cka="mod-7" type="checkbox">
                            <label>全部</label>
                        </h4>
                        <ul class="ncap-account-container-list">
                            <li><label><input class="checkbox" name="urls[]" ck="mod-7" value="report/sales_profile" <?php if(in_array("report/sales_profile" ,$urls)){ echo "checked"; } ?> type="checkbox">数据概况</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-7" value="report/order" <?php if(in_array("report/order" ,$urls)){ echo "checked"; } ?> type="checkbox">订单统计</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-7" value="report/hot_ranking" <?php if(in_array("report/hot_ranking" ,$urls)){ echo "checked"; } ?> type="checkbox">热销排行</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-7" value="report/agent_ranking" <?php if(in_array("report/agent_ranking" ,$urls)){ echo "checked"; } ?> type="checkbox">代理排行</label></li>
                        </ul>
                    </div>

                    <div class="ncap-account-container" style="border-top:none;">
                        <h4>
                            <label>插件功能</label>
                            <input value="1" cka="mod-8" type="checkbox">
                            <label>全部</label>
                        </h4>
                        <ul class="ncap-account-container-list">
                            <li><label><input class="checkbox" name="urls[]" ck="mod-8" value="XXX/XXX" <?php if(in_array("XXX/XXX" ,$urls)){ echo "checked"; } ?> type="checkbox">功能开通</label></li>
                            <li><label><input class="checkbox" name="urls[]" ck="mod-8" value="XXX/XXX" <?php if(in_array("XXX/XXX" ,$urls)){ echo "checked"; } ?> type="checkbox">营销插件</label></li>
                        </ul>
                    </div>
                </dd>
            </dl>

            <div class="bot"><a href="JavaScript:void(0);" onclick="roleSubmit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a></div>
        </div>
        <input type="hidden" name="role_id" value="{$role['role_id']}"/>
    </form>
</div>
<script type="text/javascript">
    $(document).ready(function(){
        $(":checkbox[cka]").click(function(){
            var $cks = $(":checkbox[ck='"+$(this).attr("cka")+"']");
            if($(this).is(':checked')){
                $cks.each(function(){$(this).prop("checked",true);});
            }else{
                $cks.each(function(){$(this).removeAttr('checked');});
            }
        });
    });

    function choosebox(o){
        var vt = $(o).is(':checked');
        if(vt){
            $('input[type=checkbox]').prop('checked',vt);
        }else{
            $('input[type=checkbox]').removeAttr('checked');
        }
    }

    function roleSubmit(){
        $('#roleform').submit();
    }
</script>
</body>
</html>